#ifndef USERREGISTERSECTION_H
#define USERREGISTERSECTION_H

#include "TcpConnection.h"
#include "Packet.h"
#include "TaskType.h"
#include <string>
using std::string;

namespace rocket
{

class UserRegisterSection1
{
public:
    UserRegisterSection1(wd::Packet& packet,wd::TcpConnectionPtr conn)
    :_conn(conn)
     ,_packet(packet)
    {}
    ~UserRegisterSection1() {}
    void process();
private:
    //产生盐值 
    string GenRandomString(int length);
    string CreateMD5Salt();
private:
    wd::TcpConnectionPtr _conn;
    wd::Packet _packet;// 存储客户端发的“用户名数据包”
};

class UserRegisterSection2
{
public:
    UserRegisterSection2(wd::Packet& packet,wd::TcpConnectionPtr conn)
    :_conn(conn)
     ,_packet(packet)
    {}
    ~UserRegisterSection2() {}
    void process();
private:
    wd::TcpConnectionPtr _conn;
    wd::Packet _packet;// 存储客户端发的“密文数据包”
};

}//end of namespace rocket
#endif
